﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Globalization;
using System.Threading;
using MovieWebApp.App_Code.Entities;
using MovieWebApp.DataAccess;
using MovieWebApp.DatabaseMarkup;

namespace MovieWebApp.Pages
{
    public partial class Genres : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected override void InitializeCulture()
        {
            if ((string)Session["Language"] != null)
            {
                string selectedLanguage = (string)Session["Language"];
                UICulture = selectedLanguage;
                Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(selectedLanguage);
                Thread.CurrentThread.CurrentUICulture = new CultureInfo(selectedLanguage);
            }
            base.InitializeCulture();
        }

        protected void imgComedy_Click(object sender, ImageClickEventArgs e)
        {
            int genreID = 9;
            List<Movies> p = MovieAccess.GetMoviesByGenre(genreID);
            pList.DataSource = p;
            pList.DataBind();
            pList.Visible = true;
            
        }

        protected void imgDrama_Click(object sender, ImageClickEventArgs e)
        {
            int genreID = 6;
            List<Movies> p = MovieAccess.GetMoviesByGenre(genreID);
            pList.DataSource = p;
            pList.DataBind();
            pList.Visible = true;

        }

        protected void imgHorror_Click(object sender, ImageClickEventArgs e)
        {
            int genreID = 10;
            List<Movies> p = MovieAccess.GetMoviesByGenre(genreID);
            pList.DataSource = p;
            pList.DataBind();
            pList.Visible = true;

        }

        protected void imgScience_Click(object sender, ImageClickEventArgs e)
        {
            int genreID = 18;
            List<Movies> p = MovieAccess.GetMoviesByGenre(genreID);
            pList.DataSource = p;
            pList.DataBind();
            pList.Visible = true;

        }

        protected void imgThriller_Click(object sender, ImageClickEventArgs e)
        {
            int genreID = 13;
            List<Movies> p = MovieAccess.GetMoviesByGenre(genreID);
            pList.DataSource = p;
            pList.DataBind();
            pList.Visible = true;

        }

        protected void imgAction_Click1(object sender, ImageClickEventArgs e)
        {
            int genreID = 1;
            List<Movies> p = MovieAccess.GetMoviesByGenre(genreID);
            pList.DataSource = p;
            pList.DataBind();
            pList.Visible = true;

        }

        protected void pList_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        protected void AddToCartLink(object sender, EventArgs e)
        {
            LinkButton clickedlink = (LinkButton)sender;
        }
    }
}
